package cn.lycode.system.service.impl;

import cn.lycode.system.mapper.SysUserRoleMapper;
import cn.lycode.system.service.SysUserRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: SysUserRoleServiceImpl
 * @Author lyg
 * @Date 2024/11/29 14:49
 * @description:
 */
@Service
@RequiredArgsConstructor
public class SysUserRoleServiceImpl implements SysUserRoleService {
    private final SysUserRoleMapper userRoleMapper;

    @Override
    public void deleteUserAllRolesByUserIds(List<Long> userIdList) {
        userRoleMapper.deleteUserAllRolesByUserIds(userIdList);
    }

    @Override
    public void deleteUserAllRoles(Long userId) {
        userRoleMapper.deleteUserAllRoles(userId);
    }

    @Override
    public void batchAddUserRoles(Long userId, List<Long> roleIds) {
        userRoleMapper.batchAddUserRoles(userId,roleIds);
    }

    @Override
    public List<Long> selectUserRoleIds(Long userId) {
        return userRoleMapper.selectUserIdsByRoleId(userId);
    }
}
